#ifndef YCCONTROLSLINEEDIT_H
#define YCCONTROLSLINEEDIT_H
#include <QLineEdit>

namespace yc {

class LineEdit : public QLineEdit
{
    Q_OBJECT

public:
    explicit LineEdit(QWidget* parent = nullptr);
    explicit LineEdit(const QString& text, QWidget* parent = nullptr);

    void setAutoClearFocus(bool auto_clear_focus);
    bool eventFilter(QObject* watched, QEvent* event) override;

Q_SIGNALS:
    void focusedIn();
    void focusedOut();

protected:
    void focusInEvent(QFocusEvent* event) override;
    void focusOutEvent(QFocusEvent* event) override;

private:
    bool auto_clear_focus_ = false;
};

} // namespace yc

#endif // YCCONTROLSLINEEDIT_H
